package com.cr.demo.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @RequestMapping(value="login", method= RequestMethod.POST)
    public String login(String name, String password) {
        System.out.println(name);
        System.out.println(password);
        return "success";
    }
    //get 方法传参 ？方式
    @RequestMapping("testParam")
    public String testRequestParam(Integer id){
        System.out.println("================"+id);
        return "success";
    }

    //get 方法传参 /方法
    @RequestMapping("/user/{id}")
    public String testPath(@PathVariable Integer id){
        System.out.println("================id为======="+id);
        return "success";
    }
}
